home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.display.MovieClip;
- import flash.events.Event;
-
- public class ObstacleChar extends MovieClip
- {
-
-
- private var §\x01\x01\x02\t§:* = null;
-
- private var §\x01\x01\x07\x03§:* = 10;
-
- internal const DOC_HEIGHT:* = 400;
-
- internal const OBTHEIGHT:* = 62.5;
-
- internal const ARMORDAMAGE:* = 2;
-
- private var §\x01\x01\x06\r§:* = null;
-
- private var §\x01\x01\t\x0e§:* = null;
-
- private var §\x01\x01\t\x0f§:*;
-
- internal const OBTWIDTH:* = 60;
-
- internal const DOC_TOP:* = 0;
-
- private var §\x01\x01\t\x10§:Boolean = true;
-
- public var attackable:Boolean;
-
- private var §\x01\x01\f\x0b§:String;
-
- internal const DOC_WIDTH:* = 640;
-
- internal const HEALTHDAMAGE:* = 5;
-
- internal const DOC_LEFT:* = 0;
-
- private var §\x01\x01\f\f§:Boolean = true;
-
- internal const OBTYPOS:* = 268.75;
-
- public function ObstacleChar()
- {
- §\x01\x01\x02\t§ = null;
- §\x01\x01\x06\r§ = null;
- §\x01\x01\t\x0e§ = null;
- §\x01\x01\x07\x03§ = 10;
- §\x01\x01\f\f§ = true;
- §\x01\x01\t\x10§ = true;
- super();
- }
-
- public function GetCharType() : String
- {
- return "obstacle";
- }
-
- public function ShowFace(param1:*) : *
- {
- switch(param1)
- {
- case 1:
- gotoAndPlay("plantstand");
- §\x01\x01\f\x0b§ = "plant";
- break;
- case 2:
- gotoAndPlay("bushstand");
- §\x01\x01\f\x0b§ = "bush";
- break;
- case 3:
- gotoAndPlay("monsterstand");
- §\x01\x01\f\x0b§ = "monster";
- break;
- case 4:
- gotoAndPlay("trunkstand");
- §\x01\x01\f\x0b§ = "trunk";
- attackable = false;
- break;
- case 5:
- gotoAndPlay("stonestand");
- §\x01\x01\f\x0b§ = "stone";
- attackable = false;
- break;
- case 11:
- gotoAndPlay(§\x01\x01\f\x0b§ + "attack");
- break;
- case 22:
- §\x01\x01\f\f§ = false;
- gotoAndPlay(§\x01\x01\f\x0b§ + "dead");
- break;
- default:
- gotoAndPlay("plantstand");
- §\x01\x01\f\x0b§ = "plant";
- }
- }
-
- public function Reset() : *
- {
- §\x01\x01\t\x10§ = true;
- §\x01\x01\f\f§ = true;
- ShowFace(99);
- §\x01\x01\x02\t§.removeEventListener(Event.ENTER_FRAME,§\x01\x01\x06\x0e§);
- §\x01\x01\x02\t§.addEventListener(Event.ENTER_FRAME,§\x01\x01\x06\x0e§,false,0,true);
- }
-
- public function Init(param1:*, param2:*, param3:*) : *
- {
- §\x01\x01\x02\t§ = param1;
- §\x01\x01\x06\r§ = param2;
- §\x01\x01\t\x0e§ = param3.theKnight;
- §\x01\x01\t\x0f§ = param3;
- §\x01\x01\t\x10§ = true;
- attackable = true;
- this.width = OBTWIDTH;
- this.height = OBTHEIGHT;
- this.y = OBTYPOS;
- §\x01\x01\x02\t§.addEventListener(Event.ENTER_FRAME,§\x01\x01\x06\x0e§,false,0,true);
- }
-
- public function GetHealthDamage() : int
- {
- if(§\x01\x01\f\f§)
- {
- if(§\x01\x01\f\x0b§ == "monster" || §\x01\x01\f\x0b§ == "plant")
- {
- return HEALTHDAMAGE * 2;
- }
- return HEALTHDAMAGE;
- }
- return 0;
- }
-
- public function SetLive(param1:*) : *
- {
- §\x01\x01\f\f§ = param1;
- if(!§\x01\x01\f\f§)
- {
- ShowFace(22);
- }
- }
-
- public function GetLive() : Boolean
- {
- return §\x01\x01\f\f§;
- }
-
- public function GetArmorDamage() : int
- {
- if(§\x01\x01\f\f§)
- {
- if(§\x01\x01\f\x0b§ == "monster")
- {
- return ARMORDAMAGE * 3;
- }
- if(§\x01\x01\f\x0b§ == "plant")
- {
- return ARMORDAMAGE * 2;
- }
- return ARMORDAMAGE;
- }
- return 0;
- }
-
- private function §\x01\x01\x06\x0e§(param1:Event) : *
- {
- if(§\x01\x01\f\f§)
- {
- if(Math.abs(§\x01\x01\t\x0e§.x - this.x) <= §\x01\x01\t\x0e§.width * 0.5 && §\x01\x01\t\x10§)
- {
- ShowFace(11);
- §\x01\x01\t\x10§ = false;
- }
- if(this.x > -100)
- {
- this.x -= §\x01\x01\x07\x03§;
- }
- else
- {
- §\x01\x01\t\x0f§.DestroyObstacle(this);
- }
- }
- else if(this.currentLabel == "smokeend")
- {
- §\x01\x01\t\x0f§.DestroyObstacle(this);
- }
- else if(this.x > -100)
- {
- this.x -= §\x01\x01\x07\x03§;
- }
- else
- {
- §\x01\x01\t\x0f§.DestroyObstacle(this);
- }
- }
-
- public function Destroy() : *
- {
- §\x01\x01\x02\t§.removeEventListener(Event.ENTER_FRAME,§\x01\x01\x06\x0e§);
- }
-
- public function GetCharScore() : int
- {
- if(§\x01\x01\f\x0b§ == "plant")
- {
- return 100;
- }
- if(§\x01\x01\f\x0b§ == "monster")
- {
- return 250;
- }
- return 50;
- }
- }
- }
-